!function(){"use strict";function t(t){var e,i,s,n;if(t.labels&&t.labels.length)return null==(e=t.labels[0].textContent)?void 0:e.trim();const r=t.closest("label");if(r)return(r.textContent||"").trim();if(t.id){const e=t.ownerDocument.querySelector(`label[for="${t.id}"]`);if(e)return null==(i=e.textContent)?void 0:i.trim()}const o=t.previousElementSibling;if(o&&"LABEL"===o.tagName)return null==(s=o.textContent)?void 0:s.trim();const a=t.parentElement;if(a){const t=["label","form-label","control-label","field-label"];for(const e of t){const t=a.querySelector("."+e);if(t)return null==(n=t.textContent)?void 0:n.trim()}}}function e(e){if("submit"===e.type||"button"===e.type||"reset"===e.type||function(e){var i,s,n,r;if("password"===e.type||"hidden"===e.type)return!0;const o=[null==(i=e.name)?void 0:i.toLowerCase(),null==(s=e.id)?void 0:s.toLowerCase(),null==(n=e.getAttribute("aria-label"))?void 0:n.toLowerCase(),null==(r=t(e))?void 0:r.toLowerCase()].filter(Boolean);for(const t of o)if(t)for(const e of L)if(t.includes(e))return!0;return!1}(e))return null;let i="";const s=e.tagName;if("INPUT"===s){const t=e;if("checkbox"===t.type||"radio"===t.type){if(!t.checked)return null;i=t.value||"on"}else i=t.value}else if("SELECT"===s){const t=e,s=t.options[t.selectedIndex];i=s?s.text||s.value:""}else"TEXTAREA"===s&&(i=e.value);return i?{id:e.id||"",name:e.name||"",type:e.type||e.tagName.toLowerCase(),tagName:e.tagName.toLowerCase(),value:i,label:t(e)}:null}function i(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}function s(){const t=window.location.hostname,e=Date.now();if(B&&3e5>e-q)return B;if(/^(\d{1,3}\.){3}\d{1,3}$/.test(t)||"localhost"===t)return B=t,q=e,t;const i=t.split(".");if(1>=i.length)return B=t,q=e,t;for(let s=0;s864e5?(sessionStorage.removeItem(K+t),null):i}catch{return null}}function o(t,e,i){try{const s={hash:e,timestamp:Date.now(),compute_time_ms:i};sessionStorage.setItem(K+t,JSON.stringify(s))}catch{}}function a(t,e=3e3){"u">typeof window&&"requestIdleCallback"in window?requestIdleCallback(t,{timeout:e}):"u">typeof window?setTimeout(t,Math.min(1e3,e)):t()}async function c(t){const e=Y.encode(t);return(t=>[...new Uint8Array(t)].map(t=>t.toString(16).padStart(2,"0")).join(""))(await crypto.subtle.digest("SHA-256",e))}function h(t){const e=new WeakSet,i=t=>null===t||"object"!=typeof t?JSON.stringify(t):e.has(t)?'"[circular]"':(e.add(t),Array.isArray(t)?"["+t.map(i).join(",")+"]":"{"+Object.keys(t).sort().map(e=>JSON.stringify(e)+":"+i(t[e])).join(",")+"}");return i(t)}function u(t){const e=document.cookie.match(RegExp(`(?:^|;\\s*)${t}=([^;]+)`));if(e)return decodeURIComponent(e[1])}function l(t){return(t.type||t.name)===w.PAGEVIEW?1:2}function d(t,e){if(!e||0===e.length)return!0;for(const i of e)if(i.startsWith("*.")){const e=i.slice(2);if(t===e||t.endsWith("."+e))return!0}else if(t===i)return!0;return!1}function f(t,e){for(const i of e)if(i.includes("*")){if(RegExp("^"+i.replace(/\*/g,".*")+"$").test(t))return!0}else if(t.includes(i))return!0;return!1}function m(t,e,i){const{timeout:s,retries:n,alwaysResolve:r=!1}=i;return new Promise((i,o)=>{let a=0;const c=()=>{if(t())return e(),void i();a++,n>a?setTimeout(c,s):r?i():o(Error(`Condition not met after ${n} attempts`))};c()})}function p(t,e){return(...i)=>e(t,...i)}var w,g,y,v,S,b,x,T=Object.defineProperty,k=(t,e,i)=>((t,e,i)=>e in t?T(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),C=Object.defineProperty,E=(t,e,i)=>((t,e,i)=>e in t?C(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);const D=t=>({namespace:"Radar",profileId:"",cdn:"",apiEndpoint:"",debug:!1,features:{downloadTracking:!1,formTracking:!1,clickTracking:!1,errorCapture:!1},integrations:{},...t});D();const _=({base:t,override:e})=>({...t,...e,features:{...t.features,...e.features},integrations:{...t.integrations,...e.integrations}});class I{constructor(t){E(this,"debug",!1),E(this,"errorEndpoint"),this.debug=!!t.debug,this.errorEndpoint=t.apiEndpoint+"/errors"}report(t){try{const e=new XMLHttpRequest;e.open("POST",this.errorEndpoint,!0),e.setRequestHeader("Content-Type","application/json"),e.send(JSON.stringify({error:t.message,stack:t.stack,timestamp:(new Date).toISOString(),source:"radar-tracker",userAgent:navigator.userAgent,url:window.location.href}))}catch{}}log(...t){this.debug&&console.log("[Radar]",...t)}warn(...t){this.debug&&console.warn("[Radar]",...t)}error(t,...e){this.debug&&console.error("[Radar]",t,...e)}}let F;const A=(...t)=>null==F?void 0:F.warn(...t),O=(t,...e)=>null==F?void 0:F.error(t,...e),P=console.warn.bind(console);class M{constructor(){k(this,"events",new Map),k(this,"middleware",[])}on(t,e){this.events.has(t)||this.events.set(t,new Set);const i=this.events.get(t);i&&i.add(e)}off(t,e){const i=this.events.get(t);i&&(i.delete(e),0===i.size&&this.events.delete(t))}use(t){this.middleware.push(t)}removeMiddleware(t){this.middleware=this.middleware.filter(e=>e!==t)}emit(t,...e){for(const n of this.middleware)try{if(!n(t,...e))return}catch(s){O(s,"Error in event middleware")}const i=this.events.get(t);i&&i.forEach(t=>{try{t(...e)}catch(s){O(s,"Error in event handler")}})}}const N=t=>Math.round(t/1e3),$={},R=(t="")=>{const e=btoa(/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)?t.replace(/^[^@]+@/,""):"");return!$[e]&&($[e]=!0,e)};w=(t=>(t.IDENTIFY="identify",t.TRACK="track",t.PAGE_VIEW="page_view",t.PAGEVIEW="pageview",t.FORM_START="form_start",t.FORM_SUBMIT="form_submit",t.FORM_ABANDON="form_abandon",t.FORM_UPDATE="form_update",t.CLICK="click",t.DOWNLOAD="download",t.INITIALIZED="initialized",t.COLLECTING="collecting",t.ERROR="error",t.OBSERVE="observe",t))(w||{});const L=["password","credit","card","ccn","cvv","secret","token","ssn","social","auth","private","security","pin"],J=["facebook.com/tr","connect.facebook.net","px.ads.linkedin.com","bat.bing.com","googleads.g.doubleclick.net","analytics.google.com/g/collect","ct.pinterest.com","analytics.twitter.com","ads.twitter.com","tr.snapchat.com","tiktok.com/i18n","ad.atdmt.com"];class U extends M{constructor(){super(...arguments),k(this,"activeFormInteractions",new Map),k(this,"submittedForms",new Set),k(this,"eventHandlersInstalled",!1),k(this,"sensitiveFields",[...L]),k(this,"originalSubmit",null),k(this,"instrumentedIframes",new Set),k(this,"iframeMutationObserver",null),k(this,"handleFormFieldFocus",t=>{const e=t.target;if(!this.isFormField(e))return;const i=this.getParentForm(e);if(!i)return;const s=this.getFormId(i);if(!this.activeFormInteractions.has(s)){const t=this.getFormName(i),n=this.isFormElement(i),r=n?i.action:"",o=n?i.method:"",a=e.ownerDocument!==document,c={formId:s,formName:t,action:r,method:o,startTime:Date.now(),lastInteraction:Date.now(),fields:{},submitted:!1,...a&&{fromIframe:a}};this.activeFormInteractions.set(s,c),this.emit(w.FORM_START,{formId:s,...a&&{fromIframe:a}})}const n=this.activeFormInteractions.get(s);n&&(this.updateFormFieldData(n,i),n.lastInteraction=Date.now())}),k(this,"handleFormFieldChange",t=>{const i=t.target;if(!this.isFormField(i))return;const s=this.getParentForm(i);if(!s)return;const n=this.getFormId(s),r=this.activeFormInteractions.get(n);if(r){this.updateFormFieldData(r,s);const t=e(i);if(t){const e=i.ownerDocument!==document;this.emit(w.FORM_UPDATE,{formId:n,formName:r.formName,fieldName:t.name||t.id||"unknown",fieldValue:t.value,fieldType:t.type,...e&&{fromIframe:e}})}}}),k(this,"handleFormSubmit",t=>{const e=t.target;if(!e||this.isTrackerForm(e,t))return;const i=this.getFormId(e),s=t.t;if(this.submittedForms.has(i)&&s)return;const n=this.activeFormInteractions.get(i);if(n)this.updateFormFieldData(n,e),n.submitted=!0;else{const t=e.ownerDocument!==document,s={formId:i,formName:this.getFormName(e),action:e.action,method:e.method,startTime:Date.now(),lastInteraction:Date.now(),fields:{},submitted:!0,...t&&{fromIframe:!0}};this.updateFormFieldData(s,e),this.activeFormInteractions.set(i,s)}this.submittedForms.add(i);const r=this.activeFormInteractions.get(i);if(!r)return;const o=N(Date.now()-r.startTime),a=function(t){var e,i;const s={};for(const[n,r]of Object.entries(t)){if("***"===r.value)continue;const t=(null==(e=r.name)?void 0:e.toLowerCase())||"",o=(null==(i=r.id)?void 0:i.toLowerCase())||"",a=n.toLowerCase();t.includes("email")||o.includes("email")||a.includes("email")?s.email=r.value:t.includes("firstname")||o.includes("firstname")||"fname"===t||"fname"===o?s.firstName=r.value:t.includes("lastname")||o.includes("lastname")||"lname"===t||"lname"===o?s.lastName=r.value:!t.includes("name")&&!o.includes("name")||s.firstName||s.lastName?t.includes("phone")||o.includes("phone")||t.includes("tel")||o.includes("tel")?s.phone=r.value:t.includes("company")||o.includes("company")||t.includes("organization")||o.includes("organization")?s.company=r.value:t.includes("title")||o.includes("title")||t.includes("position")||o.includes("position")?s.title=r.value:(t.includes("username")||o.includes("username"))&&(s.username=r.value):s.name=r.value}return s}(r.fields),c=e.ownerDocument!==document;this.emit(w.FORM_SUBMIT,{formId:i,formName:r.formName,action:r.action,method:r.method,timeSpent:o,fields:r.fields,traits:a,...c&&{fromIframe:c}})}),k(this,"handlePageUnload",()=>{for(const[t,e]of this.activeFormInteractions.entries()){if(e.submitted||this.submittedForms.has(t))continue;const i=N(Date.now()-e.startTime),s=N(Date.now()-e.lastInteraction);this.emit(w.FORM_ABANDON,{formId:t,formName:e.formName,timeSpent:i,timeSinceLastInteraction:s,fieldCount:Object.keys(e.fields).length,fields:e.fields,...e.fromIframe&&{fromIframe:!0}})}})}addSensitiveField(t){this.sensitiveFields.includes(t)||this.sensitiveFields.push(t)}startTracking(){typeof window>"u"||this.eventHandlersInstalled||(document.addEventListener("focusin",this.handleFormFieldFocus,!0),document.addEventListener("change",this.handleFormFieldChange,!0),document.addEventListener("submit",this.handleFormSubmit,!0),window.addEventListener("beforeunload",this.handlePageUnload),this.patchFormSubmitMethod(),this.instrumentIframes(),this.observeNewIframes(),this.eventHandlersInstalled=!0)}stopTracking(){var t;typeof window>"u"||!this.eventHandlersInstalled||(document.removeEventListener("focusin",this.handleFormFieldFocus,!0),document.removeEventListener("change",this.handleFormFieldChange,!0),document.removeEventListener("submit",this.handleFormSubmit,!0),window.removeEventListener("beforeunload",this.handlePageUnload),this.unpatchFormSubmitMethod(),null==(t=this.iframeMutationObserver)||t.disconnect(),this.iframeMutationObserver=null,this.cleanupIframeListeners(),this.eventHandlersInstalled=!1)}isFormField(t){const e=t.tagName;return"INPUT"===e||"SELECT"===e||"TEXTAREA"===e}isFormVisible(t){const e=(t.ownerDocument.defaultView||window).getComputedStyle(t);return!("none"===e.display||"hidden"===e.visibility||"0"===e.opacity||0===t.offsetWidth||0===t.offsetHeight)}isTrackerForm(t,e){return!(!function(t){if(!t)return!1;const e=t.toLowerCase();return J.some(t=>e.includes(t))}(t.action)&&(e.isTrusted||e.t)&&this.isFormVisible(t))}getParentForm(t){const e=t.closest("form");if(e)return e;const i=t.closest("section");if(i)return i;const s=t.closest("article");if(s)return s;let n=t.parentElement;for(;n&&n!==t.ownerDocument.body;){if("DIV"===n.tagName){const t=n.className||"",e=n.id||"";if(t.includes("form")||e.includes("form"))return n}n=n.parentElement}const r=["[data-form]",'[role="form"]',".form-container",".form-wrapper"];for(const o of r){const e=t.closest(o);if(e instanceof HTMLElement)return e}return t.ownerDocument.body}isFormElement(t){return"FORM"===t.tagName}getFormId(t){if(this.isFormElement(t)){if(t.id)return t.id;if(t.name)return t.name}const e=t.getAttribute("data-form-id");if(e)return e;if(!this.isFormElement(t)){t.i||(t.i=Math.random().toString(36).substr(2,9));const e=t.i;return t.id?`container_${t.id}_${e}`:t.className?`container_${t.className.split(" ")[0]}_${e}`:t===document.body?"container_body":"container_standalone_"+e}const i=t.className||"";return i?"form_"+i.split(" ")[0]:(t.o||(t.o="form_"+Math.random().toString(36).substr(2,9)),t.o)}getFormName(t){var e,i;return[t.getAttribute("name"),t.getAttribute("data-form-name"),t.getAttribute("aria-label"),null==(i=null==(e=t.querySelector("h1, h2, h3, legend"))?void 0:e.textContent)?void 0:i.trim()].filter(Boolean)[0]||void 0}updateFormFieldData(t,i){const s=i.querySelectorAll("input, select, textarea");for(const n of s){const i=e(n),s=R((null==i?void 0:i.value)||"");if(s&&"string"==typeof s&&this.emit(w.OBSERVE,s),i&&i.value){const e=i.name||i.id||i.label||"field_"+Object.keys(t.fields).length;t.fields[e]=i}}}patchFormSubmitMethod(){if(typeof window>"u"||this.originalSubmit)return;this.originalSubmit=HTMLFormElement.prototype.submit;const t=this;HTMLFormElement.prototype.submit=function(){var e;const i=t.getFormId(this);if(!t.submittedForms.has(i)){const t=new Event("submit",{bubbles:!0,cancelable:!0});t.t=!0,this.dispatchEvent(t)}null==(e=t.originalSubmit)||e.call(this)}}unpatchFormSubmitMethod(){this.originalSubmit&&"u">typeof window&&(HTMLFormElement.prototype.submit=this.originalSubmit,this.originalSubmit=null)}instrumentIframes(){const t=document.querySelectorAll("iframe");for(const e of t)this.instrumentIframe(e)}instrumentIframe(t){if(this.instrumentedIframes.has(t))return;const e=()=>{try{const e=t.contentDocument,i=t.contentWindow;if(!e||!i)return;e.addEventListener("focusin",this.handleFormFieldFocus,!0),e.addEventListener("change",this.handleFormFieldChange,!0),e.addEventListener("submit",this.handleFormSubmit,!0),i.addEventListener("beforeunload",this.handlePageUnload),this.instrumentedIframes.add(t)}catch{}};e(),t.addEventListener("load",()=>{this.instrumentedIframes.delete(t),e()})}observeNewIframes(){document.body&&(this.iframeMutationObserver=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)if(t instanceof HTMLElement)if(t instanceof HTMLIFrameElement)this.instrumentIframe(t);else{const e=t.querySelectorAll("iframe");for(const t of e)this.instrumentIframe(t)}}),this.iframeMutationObserver.observe(document.body,{childList:!0,subtree:!0}))}cleanupIframeListeners(){for(const t of this.instrumentedIframes)try{const e=t.contentDocument,i=t.contentWindow;e&&(e.removeEventListener("focusin",this.handleFormFieldFocus,!0),e.removeEventListener("change",this.handleFormFieldChange,!0),e.removeEventListener("submit",this.handleFormSubmit,!0)),i&&i.removeEventListener("beforeunload",this.handlePageUnload)}catch{}this.instrumentedIframes.clear()}}class j extends M{constructor(){super(),k(this,"eventHandlersInstalled",!1),k(this,"privacySettings",{trackAllClicks:!1,collectPositionData:!0,collectModifierData:!0}),k(this,"trackDownloadClick",t=>{var e,i;const s=RegExp("[^/]*.(pdf|doc|docx|xls|xlsx|ppt|pptx|txt|csv|rtf|odt|ods|odp|pages|numbers|zip|rar|7z|tar|gz|dmg|exe|iso|mp4|mov|avi|mkv|wmv|mp3|wav|ogg|m4a|psd|ai|xd|sketch|fig|indd)$"),n=null==(i=null==(e=null==t?void 0:t.properties)?void 0:e.href)?void 0:i.match(s);n&&this.emit(w.DOWNLOAD,{properties:{...t.properties,fileName:n[0],href:t.properties.href||"",elementPath:t.properties.elementPath}})}),k(this,"handleClick",t=>{const e=t.target,i=this.findClickableElement(e)||(this.privacySettings.trackAllClicks?e:null);if(!i)return;const s=this.extractElementData(i,e,t);this.emit(w.CLICK,{properties:s})})}startTracking(){this.eventHandlersInstalled||typeof window>"u"||(document.addEventListener("click",this.handleClick,!0),this.eventHandlersInstalled=!0,this.on(w.CLICK,this.trackDownloadClick))}stopTracking(){!this.eventHandlersInstalled||typeof window>"u"||(document.removeEventListener("click",this.handleClick,!0),this.eventHandlersInstalled=!1)}updatePrivacySettings(t){this.privacySettings={...this.privacySettings,...t}}findClickableElement(t){if(this.isClickableElement(t))return t;let e=t.parentElement;for(;e;){if(this.isClickableElement(e))return e;e=e.parentElement}return null}isClickableElement(t){const e=t.tagName.toLowerCase();if(["a","button"].includes(e))return!0;if("input"===e){const e=t.getAttribute("type");if("button"===e||"submit"===e)return!0}return!("button"!==t.getAttribute("role")&&!t.hasAttribute("onclick")&&!t.hasAttribute("data-track-event"))}extractElementData(t,e,i){var s;const n=t.tagName,r=t.id||"",o=Array.from(t.classList).join(" "),a=t.getAttribute("href")||"",c=(null==(s=t.textContent)?void 0:s.trim())||"";let h=n.toLowerCase();"INPUT"===n&&(h=`${n.toLowerCase()}[${t.getAttribute("type")||""}]`);const u=this.getDataAttributes(t),l=this.getDomPath(t),d=t.parentElement,f=d?{id:d.id||void 0,classes:d.className||void 0,tag:d.tagName.toLowerCase()}:{};let m,p;if(this.privacySettings.collectPositionData){const e=t.getBoundingClientRect();m={x:e.left+window.scrollX,y:e.top+window.scrollY,viewport:{x:e.left,y:e.top},elementSize:{width:e.width,height:e.height}}}return this.privacySettings.collectModifierData&&(p={ctrl:i.ctrlKey,alt:i.altKey,shift:i.shiftKey,meta:i.metaKey}),{elementId:r,elementType:h,elementTag:n,elementText:c,classes:o,href:a,attributes:u,elementPath:l,parentInfo:f,position:m,clickType:i.button,modifiers:p,isVisible:this.isElementVisible(t)}}getDataAttributes(t){const e={};for(const i of Array.from(t.attributes))i.name.startsWith("data-")&&"data-track-event"!==i.name&&(e[i.name.slice(5).replace(/-([a-z])/g,(t,e)=>e.toUpperCase())]=i.value);return e}getDomPath(t){const e=[];let i=t;for(;i&&"HTML"!==i.tagName;){let t=i.tagName.toLowerCase();if(i.id)t+="#"+i.id;else if(i.className&&"string"==typeof i.className){const e=i.className.split(" ");e.length>0&&e[0]&&(t+="."+e[0])}e.unshift(t),i=i.parentElement}return e.join(" > ")}isElementVisible(t){const e=window.getComputedStyle(t);return!("none"===e.display||"hidden"===e.visibility||"0"===e.opacity||0===t.offsetWidth||0===t.offsetHeight)}}class z{constructor(t={}){k(this,"isActive",!1),k(this,"isPageVisible",!0),k(this,"lastActivityTime",Date.now()),k(this,"activeStartTime",null),k(this,"accumulatedTime",0),k(this,"activityCheckInterval",null),k(this,"inactivityThreshold",6e4),k(this,"segments",[]),t.inactivityThreshold&&(this.inactivityThreshold=t.inactivityThreshold),this.lastActivityTime=Date.now(),this.isActive=!0,"u">typeof window&&(this.setupVisibilityListener(),this.setupActivityListeners(),this.checkActivity(),this.isPageVisible="visible"===document.visibilityState)}setupVisibilityListener(){"u">typeof document&&document.addEventListener("visibilitychange",()=>{this.isPageVisible="visible"===document.visibilityState,this.updateTracking()})}setupActivityListeners(){"u">typeof window&&["mousedown","mousemove","keypress","scroll","touchstart"].forEach(t=>{window.addEventListener(t,()=>{this.recordActivity()})})}recordActivity(){this.lastActivityTime=Date.now(),this.isActive=!0,this.updateTracking()}checkActivity(){this.activityCheckInterval=window.setInterval(()=>{Date.now()-this.lastActivityTime>this.inactivityThreshold&&this.isActive&&(this.isActive=!1,this.updateTracking())},100)}updateTracking(){const t=this.isPageVisible&&this.isActive;if(t&&null===this.activeStartTime)this.activeStartTime=Date.now();else if(!t&&null!==this.activeStartTime){const t=Date.now(),e=t-this.activeStartTime;this.accumulatedTime+=e,this.segments.push({start:this.activeStartTime,end:t,location:window.location.href}),this.activeStartTime=null}}getEngagementTime(){let t=this.accumulatedTime;return null!==this.activeStartTime&&(t+=Date.now()-this.activeStartTime),N(t)}getEngagementSegments(){const t=[...this.segments];return null!==this.activeStartTime&&t.push({start:this.activeStartTime,end:Date.now(),location:window.location.href}),t}reset(){this.accumulatedTime=0,this.activeStartTime=null,this.segments=[],this.lastActivityTime=Date.now(),this.isActive=!0}simulateActivity(){this.lastActivityTime=Date.now(),this.isActive=!0,this.updateTracking()}simulateVisibilityChange(t){this.isPageVisible=t,this.updateTracking()}simulateInactivity(){this.isActive=!1,this.updateTracking()}destroy(){this.activityCheckInterval&&(clearInterval(this.activityCheckInterval),this.activityCheckInterval=null),null!==this.activeStartTime&&(this.isActive=!1,this.updateTracking())}}class H{constructor(t="radar_"){k(this,"prefix"),this.prefix=t}getPrefixedKey(t){return this.prefix+t}safeParse(t){try{return JSON.parse(t)}catch{return t}}safeStringify(t){return"string"==typeof t?t:JSON.stringify(t)}}let B,q=0;const G="__sn_tld_probe";g=(t=>(t.ESSENTIAL="essential",t.FUNCTIONAL="functional",t.ANALYTICS="analytics",t.MARKETING="marketing",t))(g||{});class V extends H{set(t,e,i={},s){const n=this.getPrefixedKey(t),r=this.safeStringify(e);try{return"cookie"!==i.storage?(localStorage.setItem(n,r),i.expires&&this.setExpiration(n,i.expires),i.cookie&&this.setCookie(n,r,i),!0):this.setCookie(n,r,i)}catch{if(!1!==i.cookie)return this.setCookie(n,r,i)}return!1}get(t,e={},i){const s=this.getPrefixedKey(t);try{if(this.hasExpired(s))return this.remove(t),null;if("cookie"!==e.storage){const t=localStorage.getItem(s);if(null!==t)return this.safeParse(t)}if(!1!==e.cookie){const t=this.getCookie(s);if(t)return this.safeParse(t)}}catch(n){A("Failed to get item from storage: "+t,n)}return null}remove(t,e={},i){const s=this.getPrefixedKey(t);let n=!1;try{"cookie"!==e.storage&&(localStorage.removeItem(s),localStorage.removeItem(s+"_expires"),n=!0),!1!==e.cookie&&(this.removeCookie(s,e),n=!0)}catch(r){return A("Failed to remove item from storage: "+t,r),!1}return n}exists(t,e={},i){return null!==this.get(t,e,i)}clear(){try{for(let e=localStorage.length-1;e>=0;e--){const t=localStorage.key(e);t&&t.startsWith(this.prefix)&&localStorage.removeItem(t)}const t=document.cookie.split(";");for(let e=0;e+i}setCookie(t,e,i={}){try{const n=i.expires instanceof Date?i.expires:new Date(Date.now()+(i.expires||864e5)),r=i.path||"/",o=i.domain||s(),a=i.sameSite||"Lax",c=i.secure||"https:"===window.location.protocol;let h=`${t}=${encodeURIComponent(e)}; path=${r}; expires=${n.toUTCString()}`;return o&&(h+="; domain="+o),a&&(h+="; SameSite="+a),c&&(h+="; Secure"),document.cookie=h,!0}catch(n){return A("Failed to set cookie: "+t,n),!1}}getCookie(t){var e;const i=null==(e=null==document?void 0:document.cookie)?void 0:e.match(`(^|;)\\s*${t}\\s*=\\s*([^;]+)`);return i?decodeURIComponent(i[2]):null}removeCookie(t,e={}){try{const i=e.path||"/",n=e.domain||s();let r=`${t}=; path=${i}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;return n&&(r+="; domain="+n),document.cookie=r,!0}catch(i){return A("Failed to remove cookie: "+t,i),!1}}}class W extends H{set(t,e,i={},s){const n=this.getPrefixedKey(t),r=this.safeStringify(e);try{return sessionStorage.setItem(n,r),!0}catch(o){return A("Failed to set item in session storage: "+t,o),!1}}get(t,e={},i){const s=this.getPrefixedKey(t);try{const t=sessionStorage.getItem(s);if(null!==t)return this.safeParse(t)}catch(n){A("Failed to get item from session storage: "+t,n)}return null}remove(t,e={},i){const s=this.getPrefixedKey(t);try{return sessionStorage.removeItem(s),!0}catch(n){return A("Failed to remove item from session storage: "+t,n),!1}}exists(t,e={},i){return null!==this.get(t,e,i)}clear(){try{const t=[];for(let e=0;e"u"||!document.cookie)return{};const t={},e=function(){const t=/_ga_([A-Z0-9]+)=([^;]+)/g;let e;for(;null!==(e=t.exec(document.cookie));){const t=e[1],i=decodeURIComponent(e[2]).split(".");if(i.length>=3){const e=i[2];if(/^\d+$/.test(e))return{sessionId:e,containerId:t}}}}();return e&&(t.ga4SessionId=e.sessionId),t}(),e=function(){if(typeof document>"u"||!document.cookie)return{};const t={},e=function(){const t=document.cookie.match(/intercom-session-[a-z0-9]+\s*=\s*([^;]+)/i);if(!t)return;const e=decodeURIComponent(t[1]).trim();return e&&"undefined"!==e&&"null"!==e?e:void 0}();return e&&(t.intercomSessionId=e),t}(),i=function(){if(typeof document>"u"||!document.cookie)return{};const t={},e=function(){const t=document.cookie.match(/(?:^|;\s*)__hssc\s*=\s*([^;]+)/);if(!t)return;const e=decodeURIComponent(t[1]).trim();if(!e||"undefined"===e||"null"===e)return;const i=e.split(".");return 2>i.length?void 0:i[1]}();return e&&(t.hubspotSessionId=e),t}();return{...this.currentSession,...t,...e,...i}}extendSession(){this.getSession(),this.currentSession&&(this.currentSession.lastActivity=(new Date).toISOString(),this.focusTimer.simulateActivity(),this.currentSession.engagementTime=this.getEngagementTime(),this.currentSession.engagementSegments=this.getEngagementSegments(),this.saveSession(this.currentSession))}endSession(){this.currentSession&&(this.currentSession.engagementTime=this.getEngagementTime(),this.currentSession.engagementSegments=this.getEngagementSegments(),this.saveSession(this.currentSession)),this.focusTimer.destroy(),this.storage.remove(this.SESSION_KEY),this.currentSession=null,this.focusTimer=new z}getSessionDuration(){const t=this.getSession();return N(Date.now()-Date.parse(t.startedAt))}getEngagementTime(){return this.focusTimer.getEngagementTime()}getEngagementSegments(){return this.focusTimer.getEngagementSegments()}createSession(){const t=(new Date).toISOString();this.focusTimer.reset();const e={id:i(),startedAt:t,lastActivity:t,engagementTime:0,engagementSegments:[]};return this.saveSession(e),e}loadSession(){return this.storage.get(this.SESSION_KEY,{},g.FUNCTIONAL)}saveSession(t){this.storage.set(this.SESSION_KEY,t,{expires:2*this.SESSION_TIMEOUT},g.FUNCTIONAL)}hasSessionExpired(t){return!t||Date.now()-Date.parse(t.lastActivity)>this.SESSION_TIMEOUT}}const K="radar_sn_",Y=new TextEncoder;class X{constructor(t,e){k(this,"DEVICE_KEY","device_id"),k(this,"TRAITS_KEY","user_traits"),k(this,"SNMETA_KEY","snmeta"),k(this,"storage"),k(this,"sessionStorage"),this.storage=t,this.sessionStorage=e}getDeviceId(){let t=this.storage.get(this.DEVICE_KEY,{cookie:!0},g.ESSENTIAL);return t||(t=i(),this.setDeviceId(t)),t}setDeviceId(t){this.storage.set(this.DEVICE_KEY,t,{cookie:!0,expires:31536e6},g.ESSENTIAL)}getTraits(){return this.storage.get(this.TRAITS_KEY,{},g.ANALYTICS)||{}}setTraits(t){const e=this.getTraits(),i={};for(const[n,r]of Object.entries(t))null!=r&&"object"!=typeof r&&(i[n]=r);const s={...e,...i};this.storage.set(this.TRAITS_KEY,s,{expires:31536e6},g.ANALYTICS)}getSnMeta(){return function(){try{const t=["sh","sg","de","rs","ped"],e={};let i=!1;for(const s of t){const t=r(s);t&&(e[s+"_id"]=t.hash,e[s+"_compute_time_ms"]=t.compute_time_ms,i=!0)}return i?btoa(JSON.stringify(e)):null}catch{return null}}()}getUser(){const t=this.getTraits(),e=this.getSnMeta(),i=function(){if(typeof document>"u"||!document.cookie)return{};const t={},e=function(){const t=document.cookie.match(/(?:^|;\s*)_ga=([^;]+)/);if(!t)return;const e=decodeURIComponent(t[1]).split(".");return 4>e.length?void 0:`${e[e.length-2]}.${e[e.length-1]}`}();return e&&(t.ga4ClientId=e),t}(),s=function(){if(typeof document>"u"||!document.cookie)return{};const t={},e=function(){const t=document.cookie.match(/intercom-id-[a-z0-9]+\s*=\s*([^;]+)/i);if(!t)return;const e=decodeURIComponent(t[1]).trim();return e&&"undefined"!==e&&"null"!==e?e:void 0}();return e&&(t.intercomVisitorId=e),t}(),n=function(){if(typeof document>"u"||!document.cookie)return{};const t={},e=function(){const t=document.cookie.match(/(?:^|;\s*)hubspotutk\s*=\s*([^;]+)/);if(!t)return;const e=decodeURIComponent(t[1]).trim();return e&&"undefined"!==e&&"null"!==e?e:void 0}();return e&&(t.hubspotUtk=e),t}(),r=function(){if(typeof document>"u"||!document.cookie)return{};const t={},e=u("_fbp");e&&(t.fbp=e);const i=u("_fbc");return i&&(t.fbc=i),t}();return{deviceId:this.getDeviceId(),traits:t,email:t.email,...e&&{snmeta:e},...i,...s,...n,...r}}reset(){this.storage.remove(this.DEVICE_KEY,{cookie:!0}),this.storage.remove(this.TRAITS_KEY)}}const Z=t=>t.split("#")[0],tt="u">typeof window&&"navigation"in window&&window.navigation?window.navigation:null;class et extends M{constructor(){super(),k(this,"lastUrl",""),k(this,"unloaded",!1),k(this,"handlePageChange",()=>{const t=Z(window.location.href);t!==this.lastUrl&&(this.emit("page.exit",{url:this.lastUrl}),this.lastUrl=t,this.unloaded=!1,this.emit("page.enter",{url:t}))}),k(this,"handlePageExit",()=>{this.unloaded||(this.unloaded=!0,this.emit("page.exit",{url:this.lastUrl}))}),k(this,"handleVisibilityChange",()=>{"visible"===document.visibilityState&&this.handlePageChange()}),"u">typeof window&&(this.lastUrl=Z(window.location.href))}start(){if(typeof window>"u")return;const t=performance.getEntriesByType("navigation");t.length>0&&"reload"===t[0].type&&this.emit("page.reload",{url:this.lastUrl}),this.emit("page.enter",{url:this.lastUrl}),tt?this.setupNavigationAPI(tt):(this.patchHistoryMethods(),window.addEventListener("popstate",this.handlePageChange)),["beforeunload","pagehide"].forEach(t=>{window.addEventListener(t,this.handlePageExit,{once:!0})}),document.addEventListener("visibilitychange",this.handleVisibilityChange)}patchHistoryMethods(){["pushState","replaceState"].forEach(t=>{var e;const i=history;if(null!=(e=i[t])&&e.u)return;const s=i[t],n=(...t)=>{s.apply(history,t),this.handlePageChange()};n.u=!0,n.l=s,i[t]=n})}setupNavigationAPI(t){t.addEventListener("currententrychange",()=>{this.handlePageChange()})}}class it extends M{constructor(){super(),k(this,"focusTimer"),k(this,"pageViewId"),k(this,"timestamp"),k(this,"nav"),k(this,"stored"),k(this,"sessionIdAtEnter",null),this.focusTimer=new z,this.pageViewId=i(),this.timestamp=(new Date).toISOString(),this.nav=new et,this.stored=this.getInitialPageData(),this.nav.on("page.enter",()=>{this.pageViewId=i(),this.focusTimer=new z,this.sessionIdAtEnter=null,this.trackCurrentPage("enter")}),this.nav.on("page.exit",()=>{this.trackCurrentPage("exit")})}getInitialPageData(){return typeof window>"u"?{url:"",title:"",referrer:"",pageViewId:this.pageViewId}:{url:window.location.href,title:document.title,referrer:document.referrer,pageViewId:this.pageViewId}}startTracking(){this.nav.start()}getPage(t=!1){return t&&(this.stored=this.getInitialPageData()),this.stored}setSessionIdAtEnter(t){this.sessionIdAtEnter=t}getSessionIdAtEnter(){return this.sessionIdAtEnter}getPageEngagementParams(t){const e="enter"===t?0:N(Date.now()-Date.parse(this.timestamp)),i="enter"===t?0:this.focusTimer.getEngagementTime(),s="enter"===t?[]:this.focusTimer.getEngagementSegments();return{stage:t,pageViewId:this.pageViewId,timestamp:this.timestamp,totalTimeOnPage:e,totalFocusTimeOnPage:i,pageEngagementSegments:s}}trackCurrentPage(t){const e={...this.getPage("enter"===t),...this.getPageEngagementParams(t)};this.emit(w.PAGEVIEW,e)}}class st extends Error{constructor(t){super("Service temporarily unavailable"),k(this,"nextAttemptTime"),this.name="CircuitBreakerOpenError",this.nextAttemptTime=t}getWaitTime(){return Math.max(0,this.nextAttemptTime-Date.now())}}class nt{constructor(t={}){k(this,"state","CLOSED"),k(this,"failureCount",0),k(this,"successCount",0),k(this,"lastFailureTime",null),k(this,"nextAttemptTime",null),k(this,"config"),this.config={failureThreshold:5,timeoutMs:6e4,successThreshold:3,monitoringWindowMs:12e4,...t}}async execute(t){if(!this.canExecute())return Promise.reject(new st(this.nextAttemptTime||Date.now()+this.config.timeoutMs));try{const e=await t();return this.onSuccess(),e}catch(e){return this.onFailure(),Promise.reject(e)}}canExecute(){const t=Date.now();switch(this.lastFailureTime&&t-this.lastFailureTime>this.config.monitoringWindowMs&&this.reset(),this.state){case"CLOSED":case"HALF_OPEN":return!0;case"OPEN":return!(!this.nextAttemptTime||t=this.config.successThreshold&&this.moveToClosed()):"CLOSED"===this.state&&(this.failureCount=0)}onFailure(){this.failureCount++,this.lastFailureTime=Date.now(),"CLOSED"===this.state?this.failureCount>=this.config.failureThreshold&&this.moveToOpen():"HALF_OPEN"===this.state&&this.moveToOpen()}moveToOpen(){this.state="OPEN",this.successCount=0,this.nextAttemptTime=Date.now()+this.config.timeoutMs}moveToHalfOpen(){this.state="HALF_OPEN",this.successCount=0,this.nextAttemptTime=null}moveToClosed(){this.state="CLOSED",this.failureCount=0,this.successCount=0,this.lastFailureTime=null,this.nextAttemptTime=null}reset(){this.moveToClosed()}getStats(){return{state:this.state,failureCount:this.failureCount,successCount:this.successCount,lastFailureTime:this.lastFailureTime,nextAttemptTime:this.nextAttemptTime}}forceState(t){this.state=t,"OPEN"===t&&(this.nextAttemptTime=Date.now()+this.config.timeoutMs)}}const rt="Rdr7xK9mPqL2vNwYsT4jHcBfG8aE5uZo";class ot{constructor(t,e={},i={}){k(this,"baseUrl"),k(this,"defaultOptions"),k(this,"circuitBreaker"),this.baseUrl=t.endsWith("/")?t:t+"/",this.defaultOptions={headers:{"Content-Type":"application/json",Accept:"application/json"},timeout:3e4,retries:1,compress:!0,baseDelay:1e3,maxDelay:3e4,jitter:!0,circuitBreaker:!0,...e},this.circuitBreaker=new nt(i)}async send(t,e,i={}){const s=this.getFullUrl(t),n=this.mergeOptions(i);return n.circuitBreaker?this.circuitBreaker.execute(()=>this.sendRequest(s,e,n)):this.sendRequest(s,e,n)}async sendRequest(t,e,i){const s={...this.sanitizeForJSON(e),_c:rt},n=JSON.stringify(s),r=new AbortController,o=setTimeout(()=>{r.abort()},i.timeout);try{const e=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:n,signal:r.signal});if(!e.ok)throw Error(`HTTP error ${e.status+""}: ${e.statusText}`);return e}catch(a){if(i.retries&&i.retries>0)return this.retryRequest(t,e,{...i,retries:i.retries-1},i.retries);throw a}finally{clearTimeout(o)}}beacon(t,e){const i=this.getFullUrl(t),s={..."string"==typeof e?JSON.parse(e):this.sanitizeForJSON(e),_c:rt},n=JSON.stringify(s);if("function"==typeof navigator.sendBeacon)return navigator.sendBeacon(i,n);try{return fetch(i,{method:"POST",body:n,keepalive:!0,mode:"cors",credentials:"omit"}),!0}catch{return!1}}async fetchJson(t,e={}){const i=this.getFullUrl(t),s=this.mergeOptions(e);return s.circuitBreaker?this.circuitBreaker.execute(()=>this.fetchJsonRequest(i,s)):this.fetchJsonRequest(i,s)}async fetchJsonRequest(t,e){const i=new AbortController,s=setTimeout(()=>{i.abort()},e.timeout);try{const e=await fetch(t,{method:"GET",headers:{Accept:"application/json"},signal:i.signal});if(!e.ok)throw Error(`HTTP error ${e.status+""}: ${e.statusText}`);return await e.json()}finally{clearTimeout(s)}}async retryRequest(t,e,i,s){const n=s-(i.retries||0),r=this.calculateBackoffDelay(n,i);return await new Promise(t=>setTimeout(t,r)),this.sendRequest(t,e,i)}calculateBackoffDelay(t,e){const i=e.baseDelay||this.defaultOptions.baseDelay||1e3,s=e.maxDelay||this.defaultOptions.maxDelay||3e4,n=void 0!==e.jitter?e.jitter:this.defaultOptions.jitter,r=Math.min(i*Math.pow(2,t-1),s);if(n){const t=.25*r,e=2*(Math.random()-.5)*t;return Math.max(0,r+e)}return r}getFullUrl(t,e){const i=e||this.baseUrl;return t.startsWith("http")?t:`${i.endsWith("/")?i:i+"/"}${t.startsWith("/")?t.slice(1):t}`}mergeOptions(t){return{...this.defaultOptions,...t,headers:{...this.defaultOptions.headers,...t.headers}}}sanitizeForJSON(t){if("string"==typeof t)return t.replace(RegExp("[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?this.sanitizeForJSON(t));const e={};for(const[i,s]of Object.entries(t))e[this.sanitizeForJSON(i)]=this.sanitizeForJSON(s);return e}return t}getCircuitBreakerStats(){return this.circuitBreaker.getStats()}forceCircuitBreakerState(t){this.circuitBreaker.forceState(t)}}y=(t=>(t[t.CRITICAL=1]="CRITICAL",t[t.HIGH=2]="HIGH",t[t.MEDIUM=3]="MEDIUM",t[t.LOW=4]="LOW",t))(y||{});class at{constructor(t={}){k(this,"items",[]),k(this,"config"),this.config={maxSize:100,maxAge:36e5,priorityLimits:{1:30,2:25,3:25,4:20},...t}}enqueue(t){const e={...t,timestamp:Date.now()};this.cleanupOldItems(),this.items.push(e),this.items.sort((t,e)=>t.priority-e.priority),this.enforceSizeLimits()}dequeue(t=1){return this.items.splice(0,t)}peek(t=1){return this.items.slice(0,t)}getByPriority(t){return this.items.filter(e=>e.priority===t)}clear(){this.items=[]}size(){return this.items.length}isEmpty(){return 0===this.items.length}getStats(){const t={1:0,2:0,3:0,4:0};let e=null,i=null;for(const s of this.items)t[s.priority]++,(null===e||s.timestampi)&&(i=s.timestamp);return{totalItems:this.items.length,priorityBreakdown:t,oldestItem:e,newestItem:i}}cleanupOldItems(){const t=Date.now()-this.config.maxAge;this.items=this.items.filter(e=>e.timestamp>=t)}enforceSizeLimits(){this.enforcePriorityLimits(),this.items.length>this.config.maxSize&&(this.items=this.items.slice(0,this.config.maxSize))}enforcePriorityLimits(){var t;const e=new Map;for(const s of this.items)e.has(s.priority)||e.set(s.priority,[]),null==(t=e.get(s.priority))||t.push(s);const i=[];for(const[s,n]of e){const t=this.config.priorityLimits[s];n.sort((t,e)=>e.timestamp-t.timestamp),i.push(...n.slice(0,t))}this.items=i.sort((t,e)=>t.priority-e.priority)}}const ct="1.19.0",ht={maxSize:200,maxAge:18e5,priorityLimits:{[y.CRITICAL]:70,[y.HIGH]:50,[y.MEDIUM]:30,[y.LOW]:20}},ut={batchSize:10,flushInterval:1e3,useBeacon:!0},lt=65536;class dt{constructor(t,e){k(this,"queue",[]),k(this,"priorityQueue"),k(this,"flushTimeout",null),k(this,"exiting",!1),k(this,"failureMode",!1),k(this,"options"),k(this,"httpClient"),k(this,"config"),k(this,"domainWarned",!1),this.config=t,this.httpClient=e,this.options={...ut,apiEndpoint:t.apiEndpoint,usePriorityQueue:!0,priorityQueueConfig:ht},this.priorityQueue=new at(this.options.priorityQueueConfig),this.setupExitHandler()}checkDomainAllowed(){if(this.domainWarned||typeof window>"u")return;const t=window.location.hostname;d(t,this.config.allowedDomains)||(this.domainWarned=!0,((...t)=>{P(...t)})(`[${this.config.namespace}] Domain "${t}" is not in allowedDomains. Check your domain configuration.`))}enqueue(t){const e={...t,timestamp:(new Date).toISOString()};if(this.exiting)this.sendImmediate([e]);else{if(t.type===w.PAGEVIEW&&t.properties&&"enter"===t.properties.stage)return this.queue.push(e),void this.flush();if(this.failureMode&&this.options.usePriorityQueue){const i=l(t);return void this.priorityQueue.enqueue({id:t.id,data:e,priority:i})}this.queue.push(e),this.queue.length{this.flush()},this.options.flushInterval)):this.flush()}}flush(){if(this.flushTimeout&&(clearTimeout(this.flushTimeout),this.flushTimeout=null),this.failureMode&&this.options.usePriorityQueue)return void this.flushPriorityQueue();if(0===this.queue.length)return;const t=[...this.queue];this.queue=[],this.sendBatch(t).catch(e=>{this.config.debug&&A("Failed to send batch, retrying...",e.message),this.handleSendFailure(t,e)})}flushPriorityQueue(){if(this.priorityQueue.isEmpty())return;const t=this.priorityQueue.dequeue(this.options.batchSize),e=t.map(t=>t.data);this.sendBatch(e).catch(e=>{this.config.debug&&A("Failed to send priority batch, retrying...",e.message),this.handlePriorityQueueFailure(t)})}async sendBatch(t){if(0!==t.length){if(this.exiting&&this.options.useBeacon)return void this.sendBeacon(t);try{await this.httpClient.send("tracker/event",this.toPayload(t)),this.failureMode&&this.exitFailureMode()}catch(e){throw this.config.debug&&A("Batch send failed:",e),e}}}sendImmediate(t){0!==t.length&&(this.options.useBeacon?this.sendBeacon(t):this.httpClient.send("tracker/event",this.toPayload(t)).catch(t=>{this.config.debug&&A("Failed to send immediate data:",t.message)}))}sendBeacon(t){const e=this.toPayload(t,!0);return this.getPayloadSize(e)>lt?this.sendSplitBeacon(t):this.httpClient.beacon("tracker/event",e)}sendSplitBeacon(t){if(1>=t.length)return this.httpClient.send("tracker/event",this.toPayload(t)).catch(t=>{this.config.debug&&A("Failed to send oversized single item:",t.message)}),!0;const e=Math.floor(t.length/2),i=t.slice(0,e),s=t.slice(e),n=this.sendBeacon(i),r=this.sendBeacon(s);return n&&r}setupExitHandler(){if(typeof window>"u")return;const t=()=>{this.exiting||(this.exiting=!0,this.flush())};try{window.addEventListener("beforeunload",t,{capture:!0}),window.addEventListener("pagehide",t,{capture:!0}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&t()})}catch(e){A("Could not set up exit handlers:",e)}}handleSendFailure(t,e){e instanceof st?(this.enterFailureMode(),this.options.usePriorityQueue?this.moveItemsToPriorityQueue(t):this.queue=[...t,...this.queue]):this.queue=[...t,...this.queue],this.flushTimeout||(this.flushTimeout=window.setTimeout(()=>this.flush(),this.options.flushInterval))}handlePriorityQueueFailure(t){for(const e of t)e.retryCount=(e.retryCount||0)+1,3>e.retryCount&&this.priorityQueue.enqueue(e);this.flushTimeout||(this.flushTimeout=window.setTimeout(()=>this.flush(),2*this.options.flushInterval))}enterFailureMode(){this.failureMode||(this.failureMode=!0,this.config.debug&&A("Entering failure mode - using priority queue"),this.options.usePriorityQueue&&(this.moveItemsToPriorityQueue(this.queue),this.queue=[]))}exitFailureMode(){if(!this.failureMode)return;this.failureMode=!1,this.config.debug&&((...t)=>{null==F||F.log(...t)})("Exiting failure mode - returning to normal queue");const t=this.priorityQueue.dequeue(this.priorityQueue.size());this.queue=t.map(t=>t.data)}moveItemsToPriorityQueue(t){for(const e of t){const t=l(e);this.priorityQueue.enqueue({id:e.id,data:e,priority:t})}}getStats(){return{failureMode:this.failureMode,normalQueueSize:this.queue.length,priorityQueueStats:this.priorityQueue.getStats(),isExiting:this.exiting}}getPriorityQueueStats(){return this.priorityQueue.getStats()}forceFailureMode(t){t?this.enterFailureMode():this.exitFailureMode()}clearQueues(){this.queue=[],this.priorityQueue.clear()}updateConfig(t){this.config=t,this.checkDomainAllowed()}getPayloadSize(t){return new Blob([JSON.stringify(t)]).size}createSafeBeaconPayload(t){const e={batch:t,metadata:{itemCount:t.length,sentAt:(new Date).toISOString(),isBeacon:!0,version:ct,workspaceId:this.config.profileId,userAgent:"u">typeof navigator?navigator.userAgent:""}};if(this.getPayloadSize(e)<=lt)return e;const i={...e,metadata:{...e.metadata,userAgent:"u">typeof navigator?navigator.userAgent.substring(0,100)+"...":""}};return this.getPayloadSize(i)>lt?{...e,metadata:{...e.metadata,userAgent:""}}:i}toPayload(t,e=!1){if(e)return this.createSafeBeaconPayload(t);const i="u">typeof navigator?navigator.userAgent:"",s={};return i.includes("Chrome/125.0.0.0 Safari/537.3")&&(s._ua=btoa(unescape(encodeURIComponent(i)))),s.batch=t,s.metadata={itemCount:t.length,sentAt:(new Date).toISOString(),isBeacon:e,version:ct,workspaceId:this.config.profileId,userAgent:i},s}}class ft extends M{constructor(t,e){var i,s;super(),k(this,"anonymousId"),k(this,"spotterUrl"),k(this,"sessionStorageKey","spotter_data"),k(this,"legacyCallback"),k(this,"ga"),this.anonymousId=e,this.spotterUrl=`${t.apiEndpoint}/bp/${t.profileId}/organisation`,this.ga=null,null!=(i=null==window?void 0:window.SpotterSettings)&&i.callback&&(this.legacyCallback=null==(s=null==window?void 0:window.SpotterSettings)?void 0:s.callback)}async init(t){this.ga=t,this.identify()}get hasGaConnections(){return this.ga&&this.ga.connections.length>0}storeIdentificationData(t){sessionStorage.setItem(this.sessionStorageKey,JSON.stringify(t))}retrieveIdentificationDataFromSession(){const t=sessionStorage.getItem(this.sessionStorageKey);return t?JSON.parse(t):null}async getSpotterData(){const t=this.retrieveIdentificationDataFromSession();if(t)return t;try{const t={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({anonymous_id:this.anonymousId,url:window.location.href})},e=await fetch(this.spotterUrl,t);if(e.ok){const t=await e.json();return this.storeIdentificationData(t),t}console.log("spotter returend an error",e.status)}catch(e){console.info("Failure to retrieve spotter data",e)}}mapToLegacySuccess(t){const e=t.data,i=Array.isArray(e.profiles)?e.profiles.reduce((t,e)=>(t[e.name]=e,t),{}):e.profiles;return{ip:"",domain:e.website,type:"business",company:{id:e.uuid,name:e.name,domain:e.website,industry:e.industry,founded_year:e.founded,employee_range:e.size,location:`${e.address.city}, ${e.address.country}`,description:"",emails:[e.email],phones:[e.phone],geo:{...e.address,street_name:e.address.street,state_code:e.address.country,country_code:e.address.state,gps:{lat:e.address.latitude,lon:e.address.longitude}},profiles:i}}}mapToLegacyFailure(){return{type:"isp"}}mapToLegacyDataset(t){return t.success?this.mapToLegacySuccess(t):this.mapToLegacyFailure()}invokeLegacyCallback(t){if(!this.legacyCallback)return;const e=this.mapToLegacyDataset(t);this.legacyCallback(e)}syncGa4Properties(t){if(!this.ga||!Array.isArray(this.ga.connections)||!t.success)return;const e={};for(const i of this.ga.connections){if(e[i.measurementId])return;const s=this.getMappedDimensions(i.mappings,t);this.sendGa4UserProperties(i.measurementId,s),e[i.measurementId]=!0}}getMappedDimensions(t,e){const i=this.mapToLegacyDataset(e);return Array.isArray(t)&&i?t.reduce((t,e)=>{const{attribute:s,dimension:n,fallback_value:r}=e,o=s.split(".").reduce((t,e)=>(null==t?void 0:t[e])??null,i);return t[n]=o||r,t},{}):{}}sendGa4UserProperties(t,e){window.dataLayer=window.dataLayer||[];const i=window.gtag||((...t)=>window.dataLayer.push(t));i("set","user_properties",e),i("event","Spotter Enriched",{...e,user_properties:{...e},event_category:"Spotter",non_interaction:!0,send_to:t})}async identify(){if(!this.legacyCallback&&!this.hasGaConnections)return;const t=await this.getSpotterData();return t?(this.invokeLegacyCallback(t),this.syncGa4Properties(t),t):void 0}}class mt{constructor(){k(this,"callbacks",[])}onConsentChange(t){return this.callbacks.push(t),()=>{const e=this.callbacks.indexOf(t);-1!==e&&this.callbacks.splice(e,1)}}notifyConsentChange(t){this.callbacks.forEach(e=>{try{e(t)}catch(i){console.error(`Error in consent callback for ${this.name}:`,i)}})}createConsentState(t,e,i,s=!0){return{analytics:t,marketing:e,functional:i,necessary:s,timestamp:new Date}}}v=(t=>(t.ANALYTICS="analytics",t.MARKETING="marketing",t.FUNCTIONAL="functional",t.NECESSARY="necessary",t))(v||{});class pt{static detectAvailableAdapter(){for(const t of this.adapters)if(t.detect())return t;return null}static getAllAdapters(){return[...this.adapters]}static registerAdapter(t){this.adapters.unshift(t)}}k(pt,"adapters",[new class extends mt{constructor(){super(...arguments),k(this,"name","Cookiebot"),k(this,"initialized",!1),k(this,"pollingInterval"),k(this,"lastConsentState",null)}detect(){return"u">typeof window&&!!window.Cookiebot}initialize(){var t;if(this.initialized||!this.detect())return;this.initialized=!0;const e=window.CookiebotOnAccept,i=window.CookiebotOnDecline;if(window.CookiebotOnAccept=()=>{e&&e();const t=this.getConsentState();t&&this.notifyConsentChange(t)},window.CookiebotOnDecline=()=>{i&&i();const t=this.getConsentState();t&&this.notifyConsentChange(t)},null!=(t=window.Cookiebot)&&t.hasResponse){const t=this.getConsentState();t&&this.notifyConsentChange(t)}else this.startConsentPolling()}hasConsent(t){const e=window.Cookiebot;if(!e||!e.hasResponse||!e.consent)return!1;if(!t)return e.consented;switch(t){case v.NECESSARY:return e.consent.necessary||!1;case v.FUNCTIONAL:return e.consent.preferences||!1;case v.ANALYTICS:return e.consent.statistics||!1;case v.MARKETING:return e.consent.marketing||!1;default:return!1}}getConsentState(){const t=window.Cookiebot;return t&&t.hasResponse&&t.consent?this.createConsentState(t.consent.statistics||!1,t.consent.marketing||!1,t.consent.preferences||!1,t.consent.necessary||!1):null}startConsentPolling(){this.pollingInterval=window.setInterval(()=>{const t=window.Cookiebot;if(t&&t.hasResponse){const t=this.getConsentState();if(t){const e=JSON.stringify(t);e!==this.lastConsentState&&(this.lastConsentState=e,this.notifyConsentChange(t))}this.stopConsentPolling()}},500)}stopConsentPolling(){this.pollingInterval&&(window.clearInterval(this.pollingInterval),this.pollingInterval=void 0)}},new class extends mt{constructor(){super(...arguments),k(this,"name","OneTrust"),k(this,"initialized",!1),k(this,"categoryMappings",{standard:{[v.NECESSARY]:"C0001",[v.FUNCTIONAL]:"C0003",[v.ANALYTICS]:"C0002",[v.MARKETING]:"C0004"},numeric:{[v.NECESSARY]:"1",[v.FUNCTIONAL]:"3",[v.ANALYTICS]:"2",[v.MARKETING]:"4"}})}detect(){return"u">typeof window&&(!!window.OneTrust||"function"==typeof window.OptanonWrapper)}initialize(){var t;if(this.initialized||!this.detect())return;this.initialized=!0;const e=window.OptanonWrapper;if(window.OptanonWrapper=()=>{e&&e(),setTimeout(()=>{const t=this.getConsentState();t&&this.notifyConsentChange(t)},100)},null!=(t=window.OneTrust)&&t.IsAlertBoxClosed()){const t=this.getConsentState();t&&this.notifyConsentChange(t)}}hasConsent(t){var e;if(null==(e=window.OneTrust)||!e.IsAlertBoxClosed())return!1;const i=window.OnetrustActiveGroups||"";if(!t)return i.length>0;const s=this.categoryMappings.standard[t],n=this.categoryMappings.numeric[t];return i.includes(s)||i.includes(n)}getConsentState(){var t;if(null==(t=window.OneTrust)||!t.IsAlertBoxClosed())return null;const e=window.OnetrustActiveGroups||"",i=e.includes(this.categoryMappings.standard[v.ANALYTICS])||e.includes(this.categoryMappings.numeric[v.ANALYTICS]),s=e.includes(this.categoryMappings.standard[v.MARKETING])||e.includes(this.categoryMappings.numeric[v.MARKETING]),n=e.includes(this.categoryMappings.standard[v.FUNCTIONAL])||e.includes(this.categoryMappings.numeric[v.FUNCTIONAL]),r=e.includes(this.categoryMappings.standard[v.NECESSARY])||e.includes(this.categoryMappings.numeric[v.NECESSARY]);return this.createConsentState(i,s,n,r)}},new class extends mt{constructor(){super(...arguments),k(this,"name","Transcend"),k(this,"initialized",!1),k(this,"pollingInterval"),k(this,"lastConsentState",null)}detect(){return"u">typeof window&&(!!window.Transcend||!!window.airgap)}initialize(){var t,e;if(this.initialized||!this.detect())return;this.initialized=!0;const i=window.Transcend;if(i||window.airgap){if(null!=i&&i.onConsentChange&&i.onConsentChange(t=>{const e=this.mapTranscendConsent(t);e&&this.notifyConsentChange(e)}),null!=i&&i.hasLoaded&&i.consent){const t=this.getConsentState();t&&this.notifyConsentChange(t)}if(window.airgap)try{const i=null==(e=(t=window.airgap).getConsent)?void 0:e.call(t);if(null!=i&&i.confirmed){const t=this.getConsentState();t&&this.notifyConsentChange(t)}else this.startConsentPolling()}catch{this.startConsentPolling()}}}hasConsent(t){var e,i,s,n,r;if(window.airgap)try{const o=null==(i=(e=window.airgap).getConsent)?void 0:i.call(e);if(null!=o&&o.confirmed){if(!t){const{Analytics:t,Advertising:e,Functional:i}=o.purposes||{};return!!(t||e||i)}switch(t){case v.NECESSARY:return!0;case v.FUNCTIONAL:return(null==(s=o.purposes)?void 0:s.Functional)??!1;case v.ANALYTICS:return(null==(n=o.purposes)?void 0:n.Analytics)??!1;case v.MARKETING:return(null==(r=o.purposes)?void 0:r.Advertising)??!1;default:return!1}}}catch{}const o=window.Transcend;if(null==o||!o.consent)return!1;if(!t){const{analytics:t,advertising:e,functional:i}=o.consent;return!!(t||e||i)}switch(t){case v.NECESSARY:return o.consent.essential??!0;case v.FUNCTIONAL:return o.consent.functional??!1;case v.ANALYTICS:return o.consent.analytics??!1;case v.MARKETING:return o.consent.advertising??!1;default:return!1}}getConsentState(){var t,e,i,s,n;if(window.airgap)try{const r=null==(e=(t=window.airgap).getConsent)?void 0:e.call(t);if(r&&r.confirmed)return this.createConsentState((null==(i=r.purposes)?void 0:i.Analytics)??!1,(null==(s=r.purposes)?void 0:s.Advertising)??!1,(null==(n=r.purposes)?void 0:n.Functional)??!1,!0)}catch{}const r=window.Transcend;return null!=r&&r.consent?this.createConsentState(r.consent.analytics??!1,r.consent.advertising??!1,r.consent.functional??!1,r.consent.essential??!0):null}mapTranscendConsent(t){return t?this.createConsentState(t.analytics??!1,t.advertising??!1,t.functional??!1,t.essential??!0):null}startConsentPolling(){this.pollingInterval=window.setInterval(()=>{var t,e;if(window.airgap)try{const i=null==(e=(t=window.airgap).getConsent)?void 0:e.call(t);if(null!=i&&i.confirmed){const t=JSON.stringify(i);if(t!==this.lastConsentState){this.lastConsentState=t;const e=this.getConsentState();e&&this.notifyConsentChange(e)}}}catch{}},500)}stopConsentPolling(){this.pollingInterval&&(window.clearInterval(this.pollingInterval),this.pollingInterval=void 0)}}]);class wt{constructor(t="Radar"){k(this,"consentGiven",!1),k(this,"storageManager"),k(this,"sessionStorage"),k(this,"persistentStorage"),k(this,"adapter",null),k(this,"unsubscribe"),this.sessionStorage=new W(t.toLowerCase()+"_"),this.persistentStorage=new V(t.toLowerCase()+"_"),this.storageManager=this.sessionStorage,this.initializeAdapter()}async initializeAdapter(){if(this.adapter=pt.detectAvailableAdapter(),this.adapter){this.adapter.initialize(),this.unsubscribe=this.adapter.onConsentChange(t=>{this.handleConsentChange(t)});const t=this.adapter.getConsentState();t&&this.handleConsentChange(t)}}handleConsentChange(t){(t.analytics||t.marketing)&&this.giveCookieConsent()}giveCookieConsent(){this.consentGiven||(this.consentGiven=!0,this.persistentStorage.migrate(this.sessionStorage),this.storageManager=this.persistentStorage)}hasConsentForCategory(t){return this.adapter?this.adapter.hasConsent(t):this.consentGiven}get hasConsent(){return this.adapter&&this.adapter.hasConsent()||this.consentGiven}getConsentState(){return this.adapter?this.adapter.getConsentState():this.consentGiven?{analytics:!0,marketing:!0,functional:!0,necessary:!0,timestamp:new Date}:null}getStorageManager(){return this.storageManager}getSessionStorageManager(){return this.sessionStorage}dispose(){this.unsubscribe&&this.unsubscribe()}}class gt extends M{constructor(t){var e;super(),k(this,"version",ct),k(this,"initialized",!1),k(this,"__queuedCommands",[]),k(this,"userStore"),k(this,"sessionManager"),k(this,"formTracker",new U),k(this,"clickTracker",new j),k(this,"pageTracker"),k(this,"transport"),k(this,"spotter"),k(this,"httpClient"),k(this,"consentManager"),k(this,"remoteSettingsLoaded",!1),k(this,"settings"),k(this,"loaderScriptSettings"),k(this,"currentPageCollectingEmitted",!1),this.loaderScriptSettings=t,this.settings=this.getInitialSettings(),this.consentManager=(e=this.settings.namespace,new wt(e)),this.settings.apiEndpoint=(t=>t.includes("http")||t.includes("localhost")?t:"https://"+t)(this.settings.apiEndpoint),(!this.settings.waitForConsent||this.hasExistingConsent())&&this.consentManager.giveCookieConsent(),(t=>{F=new I(t)})({debug:this.settings.debug,apiEndpoint:this.settings.apiEndpoint}),this.userStore=new X(this.consentManager.getStorageManager(),this.consentManager.getSessionStorageManager()),this.sessionManager=new Q(this.consentManager.getStorageManager()),this.httpClient=new ot(this.settings.apiEndpoint),this.transport=new dt(this.settings,this.httpClient),this.pageTracker=new it,this.spotter=new ft(this.settings,this.userStore.getDeviceId())}async init(){var t,e,i;this.initialized||(this.initialized=!0,"u">typeof window&&(null==(t=this.m)?void 0:t.length)>0&&(function(t,e){for(const[s,...n]of e)if("function"==typeof t[s])try{t[s](...n)}catch(i){O(i,"Error executing queued operation")}else A("Unknown method called from queue: "+s)}(this,this.m),this.m=[]),this.startSnMetaComputation(),this.startPageTracking(),await this.applyRemoteSettings(),this.startFormTracking(this.settings.features.formTracking),this.startclickTracking({...this.settings.features}),this.emit(w.INITIALIZED,{version:this.version}),this.spotter.init(null==(i=null==(e=this.settings)?void 0:e.integrations)?void 0:i.ga),typeof window>"u"||(function(t){m(()=>"u">typeof window.analytics&&"function"==typeof window.analytics.ready,()=>{const e=window.analytics;e&&e.ready(()=>{if("function"==typeof e.user){const i=e.user().traits(),s=null==i?void 0:i.email;s&&"string"==typeof s&&s.includes("@")&&t.identify(s,i,"segment")}e.on("track",(e,i)=>{t.track(e,i||{},"segment")}),e.on("identify",(e,i)=>{const s=null==i?void 0:i.email;!s||"string"!=typeof s||!s.includes("@")||t.identify(s,i,"segment")}),e.on("reset",()=>{t.reset()})})},{timeout:100,retries:20,alwaysResolve:!0})}(this),function(t){m(()=>"u">typeof window.rudderanalytics&&"function"==typeof window.rudderanalytics.ready,()=>{const e=window.rudderanalytics;e&&e.ready(()=>{const i=e.getUserTraits();let s={};e.getGroupTraits&&(s=e.getGroupTraits()||{});const n=null==i?void 0:i.email;if(n&&"string"==typeof n&&n.includes("@")){let e=i;Object.keys(s).length>0&&(e={...e,$account:s}),t.identify(n,e,"rudderstack")}e.track=p(e.track,(e,...i)=>{const s=i[0],n=i[1];return"string"==typeof s&&t.track(s,n||{},"rudderstack"),e(...i)}),e.identify=p(e.identify,(e,...i)=>{const s=i[1]||{},n=s.email;return n&&"string"==typeof n&&n.includes("@")&&t.identify(n,s,"rudderstack"),e(...i)})})},{timeout:1e3,retries:10,alwaysResolve:!0})}(this)))}startSnMetaComputation(){a(async()=>{if(r("sh"))return;const t=performance.now();try{const e=()=>{try{return Number.isFinite(navigator.hardwareConcurrency)?navigator.hardwareConcurrency:null}catch{return null}},i=()=>{try{return"number"==typeof navigator.deviceMemory?navigator.deviceMemory:null}catch{return null}},s=()=>{try{const t=navigator.maxTouchPoints??navigator.msMaxTouchPoints??0;return Number.isFinite(t)?t:0}catch{return 0}},n={platform:(()=>{try{return navigator.platform||null}catch{return null}})(),hardwareConcurrency:e(),deviceMemory:i(),maxTouchPoints:s()};o("sh",await c(h(n)),Math.round(performance.now()-t))}catch{}},500),a(async()=>{if(r("sg"))return;const t=performance.now();try{const e=()=>{try{return screen.colorDepth??null}catch{return null}},i=()=>{try{const t="__ls_test__"+Math.random();localStorage.setItem(t,"1");const e="1"===localStorage.getItem(t);return localStorage.removeItem(t),e}catch{return!1}},s=()=>{try{const t="__ss_test__"+Math.random();sessionStorage.setItem(t,"1");const e="1"===sessionStorage.getItem(t);return sessionStorage.removeItem(t),e}catch{return!1}},n=()=>{try{return!!window.indexedDB}catch{return!1}},r={cookiesEnabled:(()=>{try{return navigator.cookieEnabled??null}catch{return null}})(),localStorageSupport:i(),sessionStorageSupport:s(),indexedDBSupport:n(),colorDepth:e()};o("sg",await c(h(r)),Math.round(performance.now()-t))}catch{}},1e3),a(async()=>{if(r("de"))return;const t=performance.now();try{const e=()=>{try{return screen&&Number.isFinite(screen.width)&&Number.isFinite(screen.height)?{width:screen.width,height:screen.height}:null}catch{return null}},i=()=>{try{return(new Date).getTimezoneOffset()}catch{return null}},s={devicePixelRatio:(()=>{try{return Number.isFinite(window.devicePixelRatio)?window.devicePixelRatio:null}catch{return null}})(),screenResolution:e(),timezoneOffset:i()};o("de",await c(h(s)),Math.round(performance.now()-t))}catch{}},1500),a(async()=>{if(r("rs"))return;const t=performance.now();try{const e=async()=>{try{const t=document.createElement("canvas");t.width=240,t.height=60;const e=t.getContext("2d");if(!e)return null;e.fillStyle="#f0f",e.fillRect(0,0,t.width,t.height),e.textBaseline="alphabetic",e.fillStyle="#0f0",e.font="16px 'Arial'",e.fillText("Cañvas FP 😎 12345",2,20),e.strokeStyle="#00f",e.lineWidth=1.5,e.strokeRect(10,10,100,30),e.globalCompositeOperation="multiply",e.fillStyle="#ff0",e.beginPath(),e.arc(120,30,20,0,2*Math.PI),e.fill();const i=t.toDataURL();return await c(i)}catch{return null}},i=()=>{try{const t=document.createElement("canvas"),e=t.getContext("webgl")||t.getContext("experimental-webgl");if(!e)return null;const i=e.getExtension("WEBGL_debug_renderer_info");return{vendor:((i?e.getParameter(i.UNMASKED_VENDOR_WEBGL):e.getParameter(e.VENDOR))||"")+"",renderer:((i?e.getParameter(i.UNMASKED_RENDERER_WEBGL):e.getParameter(e.RENDERER))||"")+""}}catch{return null}},s=()=>{try{const t=["Arial","Verdana","Times New Roman","Courier New","Trebuchet MS","Georgia","Helvetica","Tahoma","Palatino","Garamond","Bookman","Candara","Calisto MT","Segoe UI","San Francisco","SF Pro Text","Roboto","Noto Sans","Ubuntu","Cantarell"],e=["monospace","sans-serif","serif"],i="mmmmmmmmmmlliWWWWWw12345",s="72px",n=document.createElement("span");n.style.position="absolute",n.style.left="-9999px",n.style.fontSize=s,n.innerHTML=i,document.body.appendChild(n);const r={};for(const a of e)n.style.fontFamily=a,r[a]={w:n.offsetWidth,h:n.offsetHeight};const o=[];for(const a of t){let t=!1;for(const i of e){n.style.fontFamily=`'${a}',${i}`;const e=n.offsetWidth,s=n.offsetHeight;if(e!==r[i].w||s!==r[i].h){t=!0;break}}t&&o.push(a)}return document.body.removeChild(n),o}catch{return null}},n=async()=>{try{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,44100,44100),e=t.createOscillator();e.type="triangle",e.frequency.value=1e3;const i=t.createDynamicsCompressor();i.threshold.value=-20,i.knee.value=15,i.ratio.value=12,i.attack.value=.003,i.release.value=.25,e.connect(i),i.connect(t.destination),e.start(0);const s=(await t.startRendering()).getChannelData(0),n=Math.floor(s.length/500);let r="";for(let o=0;o=r.length);o+=n);return await c(r)}catch{return null}},[r,a,u,l]=await Promise.all([e(),i(),s(),n()]);o("rs",await c(h({canvasHash:r,webglRenderer:a,fontsDetected:u,audioHash:l})),Math.round(performance.now()-t))}catch{}},3e3),a(async()=>{if(r("ped"))return;const t=performance.now();try{const e=()=>{try{return navigator.userAgent||null}catch{return null}},i=()=>{try{if(!navigator.plugins)return null;const t=[];for(let e=0;e{try{const t=document.createElement("div");t.className="adsbox ad-banner ad-unit advertisement",t.style.position="absolute",t.style.height="10px",t.style.width="10px",t.style.left="-9999px",document.body.appendChild(t);const e="none"===getComputedStyle(t).display||null===t.offsetParent||0===t.clientHeight;return document.body.removeChild(t),e}catch{return null}},n=()=>{try{return navigator.doNotTrack||window.doNotTrack||navigator.msDoNotTrack||"unspecified"}catch{return"unspecified"}},r=()=>{try{return navigator.language||navigator.languages&&navigator.languages[0]||null}catch{return null}},a=async()=>{try{return navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?(await navigator.mediaDevices.enumerateDevices()).reduce((t,e)=>(t[e.kind]=(t[e.kind]||0)+1,t),{}):null}catch{return null}},u=()=>{try{const t={webdriver:!!navigator.webdriver,ua_platform_mismatch:!1},e=(navigator.userAgent||"").toLowerCase(),i=(navigator.platform||"").toLowerCase();return i.includes("win")&&!e.includes("win")&&(t.ua_platform_mismatch=!0),(i.includes("mac")||i.includes("iphone")||i.includes("ipad"))&&!(e.includes("mac")||e.includes("os x")||e.includes("iphone")||e.includes("ipad"))&&(t.ua_platform_mismatch=!0),i.includes("linux")&&!e.includes("linux")&&(t.ua_platform_mismatch=!0),t}catch{return{webdriver:null,ua_platform_mismatch:null}}},l=await a(),d={userAgent:e(),plugins:i(),adblockDetected:s(),doNotTrack:n(),language:r(),mediaDevicesSummary:l,hasLiedFlags:u()};o("ped",await c(h(d)),Math.round(performance.now()-t))}catch{}},2e3)}getInitialSettings(){const t=D({waitForConsent:this.loaderScriptSettings.profileId.startsWith("c")});return _({base:t,override:this.loaderScriptSettings})}hasExistingConsent(){try{const t=new V(this.settings.namespace.toLowerCase()+"_");return t.exists("device_id")||t.exists("session")}catch{return!1}}startPageTracking(){this.pageTracker.on(w.PAGEVIEW,t=>{if("enter"===t.stage){this.currentPageCollectingEmitted=!1,this.maybeEmitCollecting(),this.sessionManager.extendSession();const e=this.getSession();this.pageTracker.setSessionIdAtEnter(e.id),this.p(w.PAGEVIEW,t,e,{id:t.pageViewId,timestamp:t.timestamp})}else{const e=this.pageTracker.getSessionIdAtEnter(),i=this.getSession(),s=e?{...i,id:e}:i;this.p(w.PAGEVIEW,t,s,{id:t.pageViewId,timestamp:t.timestamp})}this.emit(w.PAGEVIEW,t)}),this.pageTracker.startTracking()}startFormTracking(t=!1){this.formTracker.on(w.FORM_START,t=>{this.emit(w.FORM_START,t)}),this.formTracker.on(w.FORM_SUBMIT,e=>{t&&this.v(w.FORM_SUBMIT,e),this.emit(w.FORM_SUBMIT,e)}),this.formTracker.on(w.FORM_ABANDON,e=>{t&&this.v(w.FORM_ABANDON,e),this.emit(w.FORM_ABANDON,e)}),this.formTracker.on(w.OBSERVE,t=>{this.v(w.OBSERVE,{snid:t})}),this.formTracker.startTracking()}startclickTracking({clickTracking:t,downloadTracking:e}){!t&&!e||(this.clickTracker.startTracking(),t&&this.clickTracker.on(w.CLICK,t=>{this.v(w.CLICK,t.properties),this.emit(w.CLICK,t)}),e&&this.clickTracker.on(w.DOWNLOAD,t=>{this.v(w.DOWNLOAD,t.properties),this.emit(w.DOWNLOAD,t)}))}S(t,e={},s,n){if(this.settings.blackListed&&s!==w.OBSERVE)return;this.sessionManager.extendSession();const r=this.getSession(),o={id:(null==n?void 0:n.id)||i(),type:s,properties:e,timestamp:(null==n?void 0:n.timestamp)||(new Date).toISOString(),page:this.pageTracker.getPage(),user:this.userStore.getUser(),session:r,name:t};this.emit(s,o),this.transport.enqueue(o)}v(t,e={},i){this.S("",e,t,i)}p(t,e,s,n){if(this.settings.blackListed&&t!==w.OBSERVE)return;const r={id:(null==n?void 0:n.id)||i(),type:t,properties:e,timestamp:(null==n?void 0:n.timestamp)||(new Date).toISOString(),page:this.pageTracker.getPage(),user:this.userStore.getUser(),session:s,name:""};this.emit(t,r),this.transport.enqueue(r)}async applyRemoteSettings(){const t=await async function(t,e,i){try{const s=await async function(t,e){const i=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json","x-tracking-script-version":e}});if(!i.ok)throw Error(`HTTP ${i.status}: ${i.statusText}`);return i}(`${t}/bp/${e}/settings`,i);return await async function(t,e){const{data:i}=await t.json();if((t=>{if(!t||"object"!=typeof t)return!1;const e=t;return(!e.profileId||"string"==typeof e.profileId)&&(!e.apiEndpoint||"string"==typeof e.apiEndpoint)&&(!e.cdn||"string"==typeof e.cdn)&&(!e.namespace||"string"==typeof e.namespace)&&(!e.allowedDomains||Array.isArray(e.allowedDomains))})(i.settings))return i.settings;throw Error(`[Radar] Invalid Runtime config received for ${e}: ${JSON.stringify(i)}`)}(s,e)}catch{return}}(this.settings.apiEndpoint,this.settings.profileId,ct);if(t){const i=_({base:this.settings,override:t}),s=_({base:i,override:this.loaderScriptSettings});e=s,typeof window>"u"||!(!1===e.countryAllowed||!d(window.location.hostname,e.allowedDomains)||!function(t,e){if(!e)return!0;const{blacklist:i,whitelist:s}=e,n=function(t){return t.replace(/^https?:\/\//,"").replace(/^www\./,"").replace(/\/$/,"")}(t);return!(null!=i&&i.length&&f(n,i)||null!=s&&s.length&&!f(n,s))}(window.location.href,e.urlFilters))||(s.blackListed=!0),this.settings=s,this.transport.updateConfig(s)}var e;this.remoteSettingsLoaded=!0,this.maybeEmitCollecting()}maybeEmitCollecting(){this.currentPageCollectingEmitted||this.remoteSettingsLoaded&&(this.settings.blackListed||(this.currentPageCollectingEmitted=!0,this.emit(w.COLLECTING,{page:this.pageTracker.getPage()})))}getSpotterIdentification(){return this.spotter.getSpotterData()}giveCookieConsent(t=!0){t&&(this.consentManager.giveCookieConsent(),this.userStore=new X(this.consentManager.getStorageManager(),this.consentManager.getSessionStorageManager()),this.sessionManager=new Q(this.consentManager.getStorageManager()))}track(t,e={},i="sdk"){const s={...e,$source:i};this.S(t,s,w.TRACK)}getSession(){return this.sessionManager.getSession()}identify(t,e,i="snitcher.sdk"){if(!t||"string"!=typeof t||!t.includes("@")||"snitcher.sdk"===this.userStore.getTraits().$source&&"snitcher.sdk"!==i)return;const s={...e,email:t,$source:i};this.userStore.setTraits(s);const n=this.userStore.getUser();this.v(w.IDENTIFY,{user:{...n,email:s.email,traits:s}}),this.emit(w.IDENTIFY,s)}register(t){!t||"object"!=typeof t||Array.isArray(t)||this.userStore.setTraits(t)}flush(){this.transport.flush()}error(t){const e="string"==typeof t?Error(t):t;this.emit(w.ERROR,e)}reset(){this.userStore.reset(),this.sessionManager.endSession()}}S=Object.defineProperty,b=(t,e,i)=>e in t?S(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,x=(t,e,i)=>b(t,"symbol"!=typeof e?e+"":e,i);const yt=!1;class vt{constructor(t){x(this,"debug",!1),x(this,"errorEndpoint"),this.debug=!!t.debug,this.errorEndpoint=t.apiEndpoint+"/errors"}report(t){try{const e=new XMLHttpRequest;e.open("POST",this.errorEndpoint,!0),e.setRequestHeader("Content-Type","application/json"),e.send(JSON.stringify({error:t.message,stack:t.stack,timestamp:(new Date).toISOString(),source:"radar-tracker",userAgent:navigator.userAgent,url:window.location.href}))}catch{}}log(...t){this.debug&&console.log("[Radar]",...t)}warn(...t){this.debug&&console.warn("[Radar]",...t)}error(t,...e){this.debug&&console.error("[Radar]",t,...e)}}let St;const bt=(t,...e)=>null==St?void 0:St.error(t,...e);console.warn.bind(console),async function(t){try{const s=function(t){var e,i;const s=t??("undefined"!=typeof document?document.getElementById("__radar__"):null);if(!s)return{};const n=function(t){const e=t.dataset;return{profileId:e.profileId||"",apiEndpoint:e.apiEndpoint||"",cdn:e.cdn||"",namespace:e.namespace||"",debug:"true"===e.debug}}(s),r=(e=s.dataset.settings,JSON.parse(e||"{}")),o={};for(const[c,h]of Object.entries(n))""!==h&&void 0!==h&&(o[c]=h);Object.assign(o,r);const a=o;return a.apiEndpoint&&(a.apiEndpoint=(i=a.apiEndpoint).includes("http")||i.includes("localhost")?i:"https://"+i),a}(t);!function(t){const e=[];if(t.apiEndpoint||e.push("apiEndpoint is required"),t.profileId||e.push("profileId is required"),t.namespace||e.push("namespace is required"),t.apiEndpoint&&!function(t){try{return new URL(t),!0}catch{return!1}}(t.apiEndpoint)&&e.push("apiEndpoint must be a valid URL"),e.length>0)throw Error("Radar configuration errors: "+e.join(", "))}(s);const n=s.debug||yt;if(e={apiEndpoint:s.apiEndpoint,debug:n},St=new vt(e),"undefined"==typeof window)throw Error("Not in a browser context");const{compatible:r,missing:o}=function(){const t={fetch:"fetch"in window,localStorage:"localStorage"in window,JSON:"JSON"in window,Promise:"Promise"in window,setTimeout:"setTimeout"in window},e=Object.entries(t).filter(([,t])=>!t).map(([t])=>t);return{compatible:0===e.length,missing:e}}();if(!r)throw Error("Browser compatibility check failed, missing: "+o);const{namespace:a}=s,c=window[a];let h;try{h=function(t){if(!t.apiEndpoint)throw Error("apiEndpoint URL is required when creating a tracker");const e=new gt(t),i=t.namespace||"Radar";if("u">typeof window&&window[i]&&Array.isArray(window[i])){const t=window[i].slice();window[i]=e,t.length>0&&(e.m=t)}return e}(s)}catch(i){throw function(t,e){t&&Array.isArray(t)&&(window[e]=t)}(c,a),i}c&&Array.isArray(c)&&(h.m=c.filter(t=>Array.isArray(t))),window[a]=h,await h.init(),h.on&&h.on("error",t=>{bt(t)})}catch(s){bt(s)}var e}("undefined"!=typeof document?document.currentScript:null)}();